<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@yield('title')</title>
    {{--<link href="{{ URL::asset('/') }}css/base.css" rel="stylesheet">
    <link href="{{ URL::asset('/') }}css/common.css" rel="stylesheet">--}}
    <link href="{{ URL::asset('/') }}css/bootstrap.min.css" rel="stylesheet">
    <link href="{{ URL::asset('/') }}css/style.css" rel="stylesheet">
    <script src="{{ URL::asset('/') }}js/jquery.min.js"></script>
    <script src="{{ URL::asset('/') }}js/default.js"></script>
    <script src="{{ URL::asset('/') }}js/jedate/jedate.js"></script>
</head>
<style>

</style>
<body>
@section('sidebar')

@show
@if (Auth::user())
    <header id="header">
        <div class="brand">
            <a href="{{ url('/admin') }}" class="logo">
                <span>公安内保系统</span>
            </a>
        </div>

        <div class="toggle-navigation toggle-left">
            <button type="button" class="btn-default">
            </button>
            <span class="tit_hidden">{$config.sitename}</span>
        </div>
        <div class="user-nav">
            <ul>
                <li class="dropdown settings">
                    <a class="dropdown-toggle">
                        {{ Auth::user()->name }}<i class="fa-angle-down"></i>
                    </a>
                </li>
            </ul>
        </div>
    </header>
    <ul class="dropdown-menu1 animated fadeInDown">
        <li>
            <a style="font-size: 20px;" href="{{ url('/admin') }}"><i style="width: 20px;" class="fa-tasks"></i> 首页</a>
        </li>
        <li>
            <a style="font-size: 20px;" href="{{ route('logout') }}" onclick="event.preventDefault();document.getElementById('logout-form').submit();"><i style="width: 20px;" class="xitong"></i> 退出</a>
            <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                {{ csrf_field() }}
            </form>
        </li>
    </ul>
    <aside class="sidebar" >
        <div id="leftside-navigation" class="nano">
            <ul class="nano-content">
                @if(isset($menu1))
                    @foreach($menu1 as $v)
                        <li class="has-sub">
                            <a href="javascript:void(0)" class="link"><i class="{{$v->icon}}"></i><span>{{$v->name}}</span><i class="arrow fa-angle-right pull-right"></i></a>
                            <ul class="sub-menu">
                                @foreach($menu2 as $vv)
                                    @if($vv->cid==$v->id)
                                        <li><a href="{{url($vv->rule)}}" targent="_blank"><i class="{{$vv->icon}}"></i>&nbsp;&nbsp;{{$vv->name}}</a></li>
                                    @endif
                                @endforeach
                            </ul>
                        </li>
                    @endforeach
                @endif
            </ul>
        </div>
    </aside>
@endif
@yield('content')
{{--<div class="container">
    @yield('content')
</div>--}}

<div class="footer">
    @yield('footer')
</div>
</body>
<script>
    $(function () {
        $('.settings ').click(function () {
            $('.fadeInDown').toggle();
        });
        $('.btn-default').on('click', function () {
            $('.sidebar').toggleClass('sidebar-toggle');
            $('.main-content-wrapper').toggleClass('main-content-toggle-left');
        });
    })
</script>
</html>